\usepackage{times}
\usepackage{fancyvrb}
\usepackage{graphicx}
\usepackage{url}
\usepackage{color, colortbl}

\definecolor{Gray}{gray}{0.95}
\definecolor{LightGray}{gray}{0.975}

\usepackage{ctable}

\newenvironment{smallitem}
 {\setlength{\topsep}{0pt}
  \setlength{\partopsep}{0pt}
  \setlength{\parskip}{0pt}
  \begin{itemize}
  \setlength{\leftmargin}{.2in}
  \setlength{\parsep}{0pt}
  \setlength{\parskip}{0pt}
  \setlength{\itemsep}{0pt}}
 {\end{itemize}}

\newenvironment{smallenum}
 {\setlength{\topsep}{0pt}
  \setlength{\partopsep}{0pt}
  \setlength{\parskip}{0pt}
  \begin{enumerate}
  \setlength{\leftmargin}{.2in}  
  \setlength{\parsep}{0pt}
  \setlength{\parskip}{0pt}
  \setlength{\itemsep}{0pt}}
 {\end{enumerate}}


\newenvironment{smalldis}
 {\setlength{\topsep}{0pt}
  \setlength{\partopsep}{0pt}
  \setlength{\parskip}{0pt}
  \begin{description}
  \setlength{\leftmargin}{.2in}  \setlength{\parsep}{0pt}
  \setlength{\parskip}{0pt}
  \setlength{\itemsep}{0pt}}
 {\end{description}}




\usepackage{listings}

\lstset{
  firstnumber=last,
  numbers=right,
  xrightmargin=2em, 
  language=Awk,
  fancyvrb=false,
  linewidth=240px,
  backgroundcolor=\color{LightGray},
  showstringspaces=false,
  formfeed=\newpage,
  tabsize=4,
  commentstyle=\itshape,
  keywordstyle=\color{blue}\scriptsize\bfseries,
  basicstyle=\scriptsize\ttfamily,
  morekeywords={models, lambda, forms,reduce,sorted},
  numberblanklines=false,
  frame=single,%shadowbox, 
  rulesepcolor=\color{LightGray}
}
\usepackage{lastpage}
\usepackage{fancyhdr}

\lstnewenvironment{code}[1][]%
{
   \noindent
   \minipage{\linewidth} 
   \vspace{0.5\baselineskip}
}
{\endminipage}

\lhead{\today}
\chead{$Title}
\rhead{Page \thepage\ of \pageref{LastPage}}
\cfoot{}


\usepackage{tocloft}

\setlength\cftparskip{-2pt}
\setlength\cftbeforesecskip{1pt}
\setlength\cftaftertoctitleskip{2pt}

